<template>
  <div :innerHTML="list.content" class="wangeditor"></div>
</template>

<script>
import E from 'wangeditor'
import {ref} from "vue";

export default {
  name: "Content",
  props: {
    list: Object
  },
  setup() {
    const previewHtml = ref();
    let editor;
    // const createEditor = () => {
    //   editor = new E('#content');
    //   editor.config.zIndex = 0;
    //   editor.create();
    // }
    return {
      previewHtml,
    }
  }
}
</script>

<style scoped>
.title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  padding: 10px;
  background-color: rgba(37, 164, 187, 0.43);
}

.wangeditor {
  max-width: 100%;
  height: auto;
}

.wangeditor table {
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
}

.wangeditor table td,
.wangeditor table th {
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #ccc;
  padding: 3px 5px;
}

.wangeditor table th {
  border-bottom: 2px solid #ccc;
  text-align: center;
}

/* blockquote 样式 */
.wangeditor blockquote {
  display: block;
  border-left: 8px solid #d0e5f2;
  padding: 5px 10px;
  margin: 10px 0;
  line-height: 1.4;
  font-size: 100%;
  background-color: #f1f1f1;
}

/* code 样式 */
.wangeditor code {
  display: inline-block;
  *display: inline;
  *zoom: 1;
  background-color: #f1f1f1;
  border-radius: 3px;
  padding: 3px 5px;
  margin: 0 3px;
}

.wangeditor pre code {
  display: block;
}

/* ul ol 样式 */
.wangeditor ul, ol {
  margin: 10px 0 10px 20px;
}

.wangeditor blockquote p {
  font-family: "YouSheBiaoTiYuan", serif;
  margin: 20px 10px !important;
  font-size: 16px !important;
  font-weight: 600;
}

.wangeditor img {
  max-width: 100%;
  height: auto;
}

</style>